package main

import (
	"fmt"
	"sync"
)

var wg sync.WaitGroup

func main() { //主线程
	for i := 0; i < 5; i++ {
		wg.Add(1) //计数牌加1
		go func(n int) {
			defer wg.Done() //计数牌减1
			fmt.Println("hello main +", n)
		}(i)
	}
	wg.Wait() //等待所有的协程都结束
}
